<?php

namespace app\api\validate;


use think\Validate;

class Index Extends Validate{

    /**
     * 验证规则
     */
    protected $rule = [
        'chip_id'       =>      'require|number',
        'chip_num'      =>      'require|number',
        'pay_password'  =>      'require|number|length:6',
        'article_id'    =>      'require|number',
        'pay_num'       =>      'require|number|min:1',
        'pay_type'      =>      'require|number|between:0,10',
        'wd_num'        =>      'require|number|min:0',
        'pay_manner'    =>      'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'chip_id.require'  =>  '认筹活动id不能为空',
        'chip_id.number'  =>  '认筹活动id不存在',
        'chip_num.require'  =>  '认筹数额不能为空',
        'chip_num.number'  =>  '认筹数额只能为数字',
        'pay_password.require'  =>  '支付密码不能为空',
        'pay_password.number'  =>  '支付密码格式有误',
        'pay_password.length'  =>  '支付密码长度有误',
        'article.require'   =>  '文章不存在',
        'article.number'   =>  '文章ID必须是数字',
        'pay_num.require'   =>  '付款金额不能为空',
        'pay_num.min'   =>  '付款金额最低为1',
        'pay_num.number'   =>  '付款金额不正确',
        'pay_type.require'   =>  '付款类型不能为空',
        'pay_type.number'   =>  '付款类型不正确',
        'pay_type.between'   =>  '付款类型不正确',
        'wd_num.require'   =>  '提现金额不能为空',
        'wd_num.number'   =>  '提现金额不是数字',
        'wd_num.min'   =>  '提现金额不能小于0',
        'pay_manner.require'   =>  '提现渠道不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'chip'  => ['chip_id','chip_num','pay_password'],
        'edit' => [],
        'notice'    =>  ['article_id'],
        'pay'    =>  ['pay_num','pay_type'],
        'withdraw'  =>  ['wd_num','pay_manner'],
    ];
}